package com.jzo2o.customer.controller.operation;

import cn.hutool.core.bean.BeanUtil;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.domain.AgencyCertificationAudit;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.request.CertificationAuditReqDTO;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationResDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author itcast
 */
@Component("agencyCertificationAuditController")
@RestController
@RequestMapping("/operation/agency-certification-audit")
@Api(tags = "运营端 - 机构认证信息相关接口")
public class AgencyCertificationAuditController {

    @Resource
    private IAgencyCertificationService agencyCertificationService;

    /**
     *  审核机构认证分页查询
     * @param reqDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("查询机构分页信息")
    public PageResult<AgencyCertificationAudit> getPageAgencyAudit(AgencyCertificationAuditPageQueryReqDTO reqDTO) {
        return agencyCertificationService.getPageAgencyAudit(reqDTO);
    }

    /**
     *  审核机构认证信息
     * @param reqDTO
     * @return
     */
    @PutMapping("/audit/{id}")
    @ApiOperation(" 审核机构认证信息")
    public Boolean auditAgencyServe(@RequestBody CertificationAuditReqDTO reqDTO,
                                    @PathVariable String id) {
        return agencyCertificationService.auditAgencyServe(reqDTO,id);
    }
}
